package com.erlang4j.api.exceptions;

import com.erlang4j.internal.exceptions.Erlang4jException;
import com.erlang4j.internal.exceptions.Erlang4jExceptionConstants;

/**
 * <p>
 * This says that you tried to get an object of class "expected" and got one of a different class
 * </p>
 * 
 * @author Phil Rice
 */
public class Erland4jDataTypeCastException extends Erlang4jException {

	// #0 is the class that was expected 1 is that class that was found 2 is the tostring of the actual object
	public Erland4jDataTypeCastException(Class<?> expected, Object actual) {
		super(Erlang4jExceptionConstants.dataTypeCastExceptionKey, expected, actual == null ? "null" : actual.getClass(), actual);
	}

}
